package leetcode.templates.palindrome;

public class Palindrome {
	// 拼接镜像数
	public long palindrome(int num) {
		long mirror = 0;
		long ans = num;
		while (num > 0) {
			mirror = mirror * 10 + num % 10;
			ans *= 10;
			num /= 10;
		}
		return ans + mirror;
	}
}
